define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Luckydrawdetail, $stateParams) {

		//接收参数
		$scope.input = new Object();
		$scope.input.id = $stateParams.id;
		
		//加载数据
		$scope.init_data = function() {
			Luckydrawdetail.getresult($scope.input.id,function(data) {
				$scope.data = data;
			});
		}
		$scope.init_data(); //必须在定义之后
		
	}

	controller.$inject = ['$scope', 'Luckydrawdetail','$stateParams'];
	
	return app.registerController("luckydrawdetailctrl",controller);
});